package com.java2nb.novel.utils;

/**
 * 聚合支付场景枚举
 */
public enum AggPaySceneEnum {
    ONLINE("ONLINE", "线上"),
    OFFLINE("OFFLINE", "线下"),
    BAOXIAN("BAOXIAN", "保险"),
    GONGYI("GONGYI", "公益"),
    DC_SEPARATION("DC_SEPARATION", "借贷分离"),
    DIGITAL("DIGITAL", "数娱"),
    REGISTRATION("REGISTRATION", "报名"),
    PRIVATE_EDUCATION("PRIVATE_EDUCATION", "民办教育"),
    DIRECT("DIRECT", "直连"),
    LARGE("LARGE", "特殊"),
    STORE_ASST("STORE_ASST", "门店助手"),
    GONGJIAO("GONGJIAO", "公缴");

    private final String code;
    private final String desc;

    AggPaySceneEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // 校验场景是否合法
    public static boolean isValid(String code) {
        for (AggPaySceneEnum e : values()) {
            if (e.code.equals(code)) return true;
        }
        return false;
    }

    // getter
    public String getCode() { return code; }
    public String getDesc() { return desc; }
}
